<?php

session_start();

  $username = $_REQUEST['username'];
  $content = $_REQUEST['content'];
  $_SESSION['user'] = $username;
  setcookie('con',$content,time()+3600,'/');
   ?>
   
   <form action="gol.php" method="post">
标题：<input type="text" name="username" value="<?php echo $_SESSION['user'];?>"><br/>
内容：<textarea rows="5px" cols="20px" name="content" >
<?php echo $_COOKIE['con'];?> 
</textarea><br/>
<button id="btn">保存</button>
</form>

<?php 
print_r($_SESSION);
echo $_SESSION['user'];
?>